//package com.wx.wxpush.job;
//
//import com.wx.wxpush.mapper.PushersMapper;
//import com.wx.wxpush.service.PushService;
//import org.mybatis.logging.Logger;
//import org.mybatis.logging.LoggerFactory;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.context.annotation.Lazy;
//import org.springframework.scheduling.annotation.EnableScheduling;
//import org.springframework.scheduling.annotation.SchedulingConfigurer;
//import org.springframework.scheduling.config.ScheduledTaskRegistrar;
//import org.springframework.scheduling.support.CronTrigger;
//import org.springframework.stereotype.Component;
//
//import java.util.concurrent.Executors;
//
//
//@Lazy(false)
//@Component
//@EnableScheduling
//public class SpringDynamicCornTask implements SchedulingConfigurer {
//
//    private static final Logger logger = LoggerFactory.getLogger(SpringDynamicCornTask.class);
//
////    private static final String DEFAULT_CRON = "7 * 22 * * ?";
//   private String cron = "7 * * * * ?";
//    @Autowired
//    private PushService pushService;
//    @Override
//    public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
//        //设置50个线程
//        taskRegistrar.setScheduler(Executors.newScheduledThreadPool(50));
//
//        taskRegistrar.addTriggerTask(() -> {
//            System.out.println("真正的任务执行逻辑早上的。。。");
//
//            //pushService.goodMorning();
//
//        }, triggerContext -> {
//            CronTrigger trigger = new CronTrigger(cron);
//            return trigger.nextExecutionTime(triggerContext);
//        }
//        );
//    }
//
//    public void setCron(String cron) {
//
//        System.out.println("原来的cron："+this.cron+"更新后的cron："+cron);
//        this.cron = cron;
//    }
//    public String getCron() {
//        return this.cron;
//    }
//}
